From 624c82cbe1750a35abbe327b48b6dcbbbfc92426 Mon Sep 17 00:00:00 2001 From: robertl Date: Wed, 9 Feb 2005 16:28:56 +0000 Subject: [PATCH] Add smarter description handling if suppressing smart icons. --- gpsbabel/garmin.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/gpsbabel/garmin.c b/gpsbabel/garmin.c index 723a57ce5..9c4334087 100644 --- a/gpsbabel/garmin.c +++ b/gpsbabel/garmin.c @@ -408,6 +408,22 @@ waypt_write_cb(GPS_PWay *way) return 0; } +/* + * If we're not using smart icons, try to put the cache info in the + * description. + */ +const char * +get_gc_info(waypoint *wpt) +{ + if (global_opts.no_smart_icons) { + if (wpt->gc_data.type == gt_virtual) return "V "; + if (wpt->gc_data.type == gt_unknown) return "? "; + if (wpt->gc_data.type == gt_multi) return "Mlt "; + if (wpt->gc_data.container == gc_micro) return "M "; + } + return ""; +} + static void waypoint_write(void) { @@ -459,7 +475,7 @@ waypoint_write(void) if (wpt->gc_data.diff && wpt->gc_data.terr) { snprintf(obuf, sizeof(obuf), "%s%d/%d %s", -wpt->gc_data.container == gc_micro ? "M " : "", + get_gc_info(wpt), wpt->gc_data.diff, wpt->gc_data.terr, src); memcpy(way[i]->cmnt, obuf, strlen(obuf)); -- 2.30.2